Queen Anne was the younger sister of Mary II (they were both daughters of James II), and this would clearly make Anne the sister–in–law of William III. But she was also his cousin.
William's mother was Mary, the eldest daughter of King Charles I of England and the younger sister of King Charles II. She married William II, Prince of Orange; William III of England was their only child.
William and Mary (and Anne) were all grandchildren of Charles I and his queen, Henrietta Maria – William through their daughter (also called Mary), Mary and Anne through their son, James II. William III was thus the first cousin of both Mary II, his wife, and Queen Anne, his sister–in–law.
© Haydn Thompson 2021